package 面试刷题.数字马力;

import java.util.Scanner;

/**
 * 第四题：https://www.nowcoder.com/exam/test/83925253/detail?pid=55292243&examPageSource=Company&testCallback=https%3A%2F%2Fwww.nowcoder.com%2Fexam%2Fcompany%3FcurrentTab%3Drecommand%26jobId%3D100%26keyword%3D%E8%9A%82%E8%9A%81%26selectStatus%3D0&testclass=%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91
 */
public class ch02取高位 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String num = sc.nextLine();
        String a = "0";
        String b = "0";
        for (int i = 0; i < num.length(); i++) {
            int v = num.charAt(i) - '0';
            if (v % 2 == 0) {
                b += v;
            } else {
                a += v;
            }
        }
        long res = Math.abs(Long.parseLong(a) - Long.parseLong(b));
        System.out.println(res);
    }
}
